<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:v="http://corejsf.com/validator">

<f:view>
<f:loadBundle var="text" basename="#{answerForm.bundleName}"/>
    <head>
        <title>#{text['answerDetail.title']}</title>
        <meta name="heading" content="#{text['answerDetail.heading']}"/>
        <style type="text/css">
            .jscalendar-DB-div-style {
                position: absolute;
                margin-top: -120px;
                margin-left: -508px;
            }
    </style>
    </head>
<body id="answerForm">

<h:form id="answerForm" onsubmit="return validateAnswerForm(this)">
<h:inputHidden value="#{answerForm.answer.answerId}" id="answerId"/>
<h:panelGrid columns="3">
    <h:outputLabel styleClass="desc" for="date" value="#{text['answer.date']}"/>
    <t:message for="date" styleClass="fieldError"/>
    <t:inputCalendar monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" id="date"
            currentDayCellClass="currentDayCell" value="#{answerForm.answer.date}"
            renderAsPopup="true" addResources="true" required="false">
    </t:inputCalendar>

    <h:panelGroup styleClass="buttonBar bottom">
        <h:commandButton value="#{text['button.save']}" action="#{answerForm.save}" id="save" styleClass="button"/>

        <c:if test="${not empty answerForm.answer.answerId}">
        <h:commandButton value="#{text['button.delete']}" action="#{answerForm.delete}"
            id="delete" styleClass="button" onclick="bCancel=true; return confirmDelete('Answer')"/>
        </c:if>

        <h:commandButton value="#{text['button.cancel']}" action="answerList" immediate="true"
            id="cancel" styleClass="button" onclick="bCancel=true"/>
    </h:panelGroup>
    <h:outputText/><h:outputText/>
</h:panelGrid>
</h:form>

<v:validatorScript functionName="validateAnswerForm"/>

<script type="text/javascript">
    //Form.focusFirstElement($('answerForm'));
    highlightFormElements();
</script>

</body>
</f:view>
</html>
